﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "server=.;database=SAA;uid=SA;pwd=LINYUHUI659";
            conn.Open();
            string sql = "select * from [Study]";
            SqlCommand gg = new SqlCommand(sql, conn);
            SqlDataReader lin = gg.ExecuteReader();
            while (lin.Read())
            {
                Console.WriteLine(lin["id"] + "\t" + lin["Name"] + "\t" + lin["sex"]);
            }
            conn.Close();
        }
    }
}
